import { defineStore } from 'pinia';

export const useMenuStore = defineStore('menu', {
  state: () => ({
    activeIndex: '1',
    menuType: '1',
    menuList: [
      { label: '考核记录', index: '1', type: '1' },
      { label: '成长记录', index: '2', type: '1' },
      { label: '能力证书', index: '3', type: '1' },
      { label: '个人信息', index: '4', type: '1' },
      { label: '个人简历', index: '5', type: '1' },
      { label: '岗位查询', index: '6', type: '1' },
      { label: '考试课程', index: '7', type: '2' },
      { label: '教师考核自测', index: '9', type: '4' },
      { label: '协会审核', index: '10', type: '5' }
    ]
  }),
  actions: {
    setActiveIndex(index) {
      this.activeIndex = index;
    },
    setMenuType(type) {
      this.menuType = type;
    },
    getMenuList(type) {
      return this.menuList.filter(item => item.type === type);
    },
  },
});